package com.oppo.userServer.application.manager;

import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.oppo.userServer.application.dto.UserDTO;
import com.oppo.userServer.infrastructure.dataObject.UserDO;

/**
 * @author 清梦
 * @version 1.0.0
 * @Description
 * @createTime 2024年03月11日 22:51:00
 */
public class UserManager {

    /**
     * 创建条件构造器
     *
     * @param userDTO 用户 DTO
     * @return {@link LambdaQueryWrapper }<{@link UserDO }>
     * @author qingmeng
     * @createTime: 2024/03/11 23:06:04
     */
    public static LambdaQueryWrapper<UserDO> createWrapper(UserDTO userDTO) {
        LambdaQueryWrapper<UserDO> wrapper = new LambdaQueryWrapper<>();
        wrapper.like(StrUtil.isNotBlank(userDTO.getUserName()),UserDO::getUserName, userDTO.getUserName());
        wrapper.like(StrUtil.isNotBlank(userDTO.getUserName()),UserDO::getUserName, userDTO.getUserName());
        return wrapper;
    }
}
